package com.lzj.demo.design.prototype;

import java.util.HashMap;
import java.util.Map;

/**
 * 初始化试卷数据
 * */
public class QuestionBankController {
    private QuestionBank questionBank = new QuestionBank();
    public QuestionBankController() {
        Map<String,String> map01 = new HashMap<>();
        map01.put("A","秀智");
        map01.put("B","朴信惠");
        Map<String,String> map02 = new HashMap<>();
        map02.put("A","IU");
        map02.put("B","Suzy");
        questionBank.append(new ChoiceQuestion("start up 的女主角是",map01,"A"))
                .append(new ChoiceQuestion("南韩第一女神",map02,"B"))
                .append(new AnswerQuestion("裴秀智的生日","1994-10-10"))
                .append(new AnswerQuestion("裴秀智主演的韩剧","当你沉睡时"));

    }

    public String createPaper(String candidate,String number) throws CloneNotSupportedException {
        QuestionBank questionBankClone = (QuestionBank) questionBank.clone();
        questionBankClone.setCandidate(candidate);
        questionBankClone.setNumber(number);
        return questionBankClone.toString();
    }
}
